<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'da.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<meta http-equiv="content-type" content="text/html;charset=utf-8">

<link rel="stylesheet" href="js/easyui/demo/demo.css" type="text/css"></link>
<link rel="stylesheet" href="js/easyui/themes/icon.css" type="text/css"></link>
<link rel="stylesheet" href="js/easyui/themes/default/easyui.css"
	type="text/css"></link>
<script type="text/javascript" src="js/easyui/jquery-1.6.min.js"></script>
<script type="text/javascript" src="js/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="script/common.js"></script>
<script type="text/javascript" src="js/easyui/themes/easyui-lang-zh_CN.js"></script>
<link href="css/style.css" rel="stylesheet" type="text/css">
<style type="text/css">

</style>
<script type="text/javascript">
	
	
</script>
</head>

<body>
	
	<div style="width: 100%">
		<div id="options" class="toolbar">
			<div style="width: 100%;float: none;">
				<div style="float: left;">
					<a href="suingetAllSuins" class="easyui-linkbutton"
						data-options="iconCls:'icon-reload'" style="margin-right: 10px;">刷新</a>
				</div>
				<div style="float: left; margin-bottom: 10px;">
					<input class="easyui-textbox" type="text" id="codeId" prompt="工艺编码" value="" data-options="height:26">
					<input class="easyui-textbox" type="text" id="nameId" prompt="工艺价格" value="" data-options="height:26">
					<input class="easyui-textbox" type="text" id="stdPriceId" prompt="工艺价格" value="" data-options="height:26">
					<select class="easyui-combobox" id="qpmtlType" style="width:140px;height:26px" prompt="工艺等级" panelHeight="100"; editable="false">
						<option value=""></option>
							<c:forEach items="${allCraftGrade }" var="crGrade">
								<c:choose>
									<c:when test="${crGrade.gradeId == gradeId}">
										<option value="${crGrade.gradeId}">${crGrade.gradeName}</option>
									</c:when><c:otherwise>
										<option value="${crGrade.gradeId}">${crGrade.gradeName}</option>
									</c:otherwise>
								</c:choose>
							</c:forEach>
					</select>
				</div>
				<div style=" float: left;">
					<input class="easyui-linkbutton"
						type="button" id="query" style="margin-left: 15px;"
						onclick="query()" value="查询 ">
				</div>
			</div>
		</div>
		
		<div style="float: left;width: 98%" id = "materialShow">
			<table class="easyui-datagrid" style="width:100%;" singleSelect="true"  data-options="onClickRow:chooseCrafts">
				<thead>
					<tr>
						<th data-options="field:'code'" width="" align="center">序号</th>
						<th data-options="field:'craftCode'" align="center">工艺编码</th>
						<th data-options="field:'craftName '" align="center">工艺名称</th>
						<th data-options="field:'typeName'" align="center">工艺类型</th>
						<th data-options="field:'count'" align="center">工艺次数</th>
						<th data-options="field:'gradeName'" align="center">工艺等级</th>
						<th data-options="field:'wageUnit'" align="center">工价</th>
						<th data-options="field:'stdTime'" align="center">标准工时</th>
						<th data-options="field:'output'" align="center">标准产量</th>
						<th data-options="field:'stdPrice'" align="center">标准价格</th>
						<th data-options="field:'demand'" align="center">工艺要求</th>
						<th data-options="field:'memo'" align="center">备注</th>
					</tr>
				</thead>
				
				<c:choose>
					<c:when test="">
						<tr style="text-align: center;">
							<td colspan="11">
								<span style="color: grey;"></span>
							</td>
						</tr>
					</c:when>
					<c:otherwise>
						<c:forEach items="${allCraft}" var="craft" varStatus="i">
							<tr>
								<td>${i.index+1+offset*10 }</td>
								<td>${craft.craftCode}</td>
								<td>${craft.craftName}</td>
								<td>${craft.typeName}</td>
								<td>${craft.count}</td>
								<td>${craft.gradeName}</td>
								<td>${craft.wage} ${craft.unit}</td>
								<td>${craft.stdTime}</td>
								<td>${craft.output}</td>
								<td>${craft.stdPrice}</td>
								<td>${craft.demand}</td>
								<td>${craft.memo}</td>
							</tr>
						</c:forEach>
					</c:otherwise>
				</c:choose>
			</table>
			<div class="pager" id="pagebar">
				共<b id="ttCount">${totalcount }</b>条记录 转到&nbsp;<input value="${offset+1}" size="2" id="offset" class="easyui-textbox" />&nbsp;页/<b id="ttPage">${totalpage }</b>页
				<button class="easyui-linkbutton jump-btn" width="20" onclick="reload()">跳转</button>
				<a onclick="turnPage(0)">&lt;&lt; 第一页</a> <a
					onclick="turnPage(${offset-1})">&lt; 上一页</a> <a
					onclick="turnPage(${offset+1})">下一页 &gt;</a> <a
					onclick="turnPage(${totalpage-1})">最后一页 &gt;&gt;</a>
			</div>
		</div>
	</div>
</body>
</html>
